import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '任务标题',
    align:"center",
    dataIndex: 'taskTitle'
   },
   {
    title: '确诊时间',
    align:"center",
    dataIndex: 'diagnosisTime'
   },
   {
    title: '病例报告',
    align:"center",
    dataIndex: 'caseImgs',
    customRender:render.renderImage,
   },
   {
    title: '病例描述',
    align:"center",
    dataIndex: 'caseDetails',
    slots: { customRender: 'htmlSlot' },
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "任务标题",
      field: 'taskTitle',
    component: 'JPopup',
    componentProps: ({ formActionType }) => {
        const {setFieldsValue} = formActionType;
        return{
            setFieldsValue:setFieldsValue,
            code:"seekmedical",
            fieldConfig: [
                { source: 'id', target: 'taskId' },
                { source: 'task_title', target: 'taskTitle' },
            ],
            multi:true
        }
    },

      colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '任务标题',
    field: 'taskTitle',
    component: 'JPopup',
    componentProps: ({ formActionType }) => {
        const {setFieldsValue} = formActionType;
        return{
            setFieldsValue:setFieldsValue,
            code:"seekmedical",
            fieldConfig: [
                { source: 'id', target: 'taskId' },
                { source: 'task_title', target: 'taskTitle' },
            ],
            multi:true
        }
    },

  },
  {
    label: '确诊时间',
    field: 'diagnosisTime',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '病例报告',
    field: 'caseImgs',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '病例描述',
    field: 'caseDetails',
    component: 'JEditor',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}